<?php
namespace app\admin\model;

/**
 * Class Witness 邀请见证表
 * @package app\admin\model
 */
class Witness extends \think\Model {

    public static $witness_status = ['未完成', '已完成']; // 见证状态
    public static $witness_examine = ['待审核', '审核通过', '审核不通过']; // 审核状态

    public function getStatusStrAttr($val, $data){
        return self::$witness_status[$data['status']];
    }
    public function getDescStrAttr($val, $data){
        $str_len = mb_strlen($data['desc']);
        $return_str = mb_substr($data['desc'], 0, 15);
        if($str_len > 15){
            $return_str .= '...';
        }
        return $return_str;
    }
    public function getImgsAttr($val){
        return explode(',', $val);
    }
    public function getExamineStrAttr($val, $data){
        $arr = ['待审核', '审核通过', '审核失败'];
        return $arr[$data['examine']];
    }

}